# $Id: configure.ac 13 2006-12-14 21:07:45Z judas $
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT([nihlib],[0.1],[nihlib@judas.sk])
AC_CONFIG_AUX_DIR([config])

AC_COPYRIGHT([Additional copyright notice])
AC_REVISION([$Rev: 17 $])

AM_INIT_AUTOMAKE

AC_CONFIG_SRCDIR([src/array.c])
AC_CONFIG_HEADER([include/nih/cdefs.h])

AM_MAINTAINER_MODE

AC_LIBTOOL_DLOPEN

AC_SUBST([NIH_LTVERSION], [0:0:0])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LIBTOOL

AC_CHECK_PROGS(DOXYGEN, [doxygen])

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h stdlib.h string.h syslog.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([strerror])

AH_TOP(
[#ifndef NIH_CDEFS_H
#define NIH_CDEFS_H 1

/* BEGIN_C_DECLS should be used at the beginning of your declarations,
   so that C++ compilers don't mangle their names.  Use END_C_DECLS at
   the end of C declarations. */
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else /* __cplusplus */
# define BEGIN_C_DECLS /* empty */
# define END_C_DECLS /* empty */
#endif /* __cplusplus */

BEGIN_C_DECLS

#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
#  define __func__ __FUNCTION__
# else
#  define __func__ "<unknown>"
# endif
#endif

#if !defined __GNUC__ || __GNUC__ < 2
# define __attribute__(xyz) /* empty */
#endif /* !defined __GNUC__ || __GNUC__ < 2 */])

AH_BOTTOM(
[#if ! HAVE_STDBOOL_H
# if ! HAVE__BOOL
#  ifdef __cplusplus
typedef bool _Bool;
#  else
#   define _Bool signed char
#  endif
# endif
# define bool _Bool
# define false 0
# define true 1
# define __bool_true_false_are_defined 1
#endif

#if !defined offsetof
# define offsetof(type, f) \
         ((size_t) ((char *)&((type *)0)->f - (char *)(type *)0))
#endif /* !defined offsetof */
END_C_DECLS

#endif /* NIH_CDEFS_H */
])

AC_CONFIG_FILES([
	Makefile

	doc/Doxyfile
	doc/Makefile

	include/Makefile
	include/nih/Makefile

	src/Makefile
	])
AC_OUTPUT
